package com.wwl.designpattern.factory.simplefactory;

import com.wwl.designpattern.factory.AutoCar;
import com.wwl.designpattern.factory.ICar;
import com.wwl.designpattern.factory.ManualCar;

/**
 * @program: DesignPattern
 * @description: 车 工厂
 * @author: wwl
 * @create: 2019-03-13 16:45
 **/
public class CarFactory {


    public ICar create(String type) {
        if ("auto".equals(type)) return new AutoCar();
        else return new ManualCar();
    }
}
